@import "variables";

.c-tooltip{
  //scale(x,y) 对元素进行缩放
  transform: scale(0);
  //transform-origin旋转位置
  transform-origin: top center;
  //will-change属性可以提前通知浏览器我们要对元素做什么动画,
  //这样浏览器可以提前准备合适的优化设置。这样可以避免对页面响应速度有重要影响的昂贵成本。
  //元素可以更快的被改变，渲染的也更快，这样页面可以快速更新，表现的更加流畅

  will-change:transform;
  z-index: 999;
  background: $tooltip-background-color;
  border-radius:2px;
  color: $tooltip-text-color;
  display: inline-block;
  font-size: $tooltip-font-size;
  font-weight: 500px;
  line-height: 14px;
  max-width: 170px;
  position: fixed;
  top:-500px;
  left: -500px;
  padding: 8px;
  text-align: center;
}
.c-tooltip.is-active{
  animation: pulse 200ms $animation-curve-linear-out-slow-in forwards;
}

@keyframes pulse {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    // Fixes a weird bug with the interaction between Safari and the result of
    // the SASS compilation for the animation.
    // Essentially, we need to make sure that "50%" and "100%" don't get merged
    // into a single "50%, 100%" entry, so we need to avoid them having any
    // matching properties.
    transform: scale(0.99);
  }
  100% {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
  }
}
